package java_new_project;

public class class_all {
    String name;
    int age;
    String gender;
    class_all(String name,int age,String gender){
        this.name =name;
        this.age =age;
        this.gender=gender;

    }
    public void print_name_age(){
        System.out.println("名字叫" + name + "，年龄是" + age);
    }
    public void print_all(){
        System.out.println("名字是"+name+",年龄是"+age+",性别是"+gender);
    }
    static class class_none extends class_all{
        class_none(String name,int age,String gender){
            super(name,age,gender);
        }
        public void print_name_gender(){
            System.out.println("名字叫"+name+","+"性别是"+gender);
        }
        public void print_name_age(){
            System.out.println("名字2叫" + name + "，年龄2是" + age);
        }
    }

    public static void main(String[] args) {
       class_all classAll = new class_all("yzy",18,"男");
       classAll.print_name_age();
       classAll.print_all();
       class_none classNone = new class_none("yzy2",19,"男");
       classNone.print_all();
       classNone.print_name_gender();
    }
}
